#! /bin/bash

# 添加分区
load_data_sql="
insert overwrite table jtp_tmp.order_report
select
    date_format(create_time,'yyyy-MM-dd') dt,
    count(*) order_count,
    sum(amt) order_amt
from jtp_tmp.ods_t_order
where dt = '${data_date}'
group by date_format(create_time,'yyyy-MM-dd');"

# 执行语句
/opt/module/spark/bin/beeline -u jdbc:hive2://node101:10001 -n bwie -e "${load_data_sql}"